﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Traceability_2203.Common.Infrastructure.Interfaces
{
    /// <summary>
    /// 基类仓储接口
    /// </summary>
    /// <typeparam name="T">占位符</typeparam>
    public interface IBaseRepository<T> where T : class, new()
    {
        /// <summary>
        /// 获取所有数据
        /// </summary>
        /// <returns></returns>
        Task<IQueryable<T>> GetAll();

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        Task<int> Add(T entity);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        Task<int> Upd(T entity);
    }
}
